//-----------------------------------------------------------------------
//<copyright file="KhoHangBLL.cs
//Code gen by tool.
//</copyright>
//-----------------------------------------------------------------------
using System;
using PMS.Exceptions;
using System.Collections.Generic;
using PMS.DAL;
using PMS.Entity;

namespace PMS.BLL
{
	public class KhoHangBO : BaseBO
	{
		// Interface Instant Object
		private readonly IKhoHangDAO khohangInterfaceObject = null;

		// Constructor
		public KhoHangBO()
		{
			khohangInterfaceObject = new DAL.ServiceFactory<IKhoHangDAO>().CurrentDAL;
		}

		#region KhoHang

		/// <summary>
		///
		/// </summary>
		/// <param name="khohang"></param>
		public KhoHang CreateKhoHang(KhoHang khohang)
		{
			try
			{
				return khohangInterfaceObject.CreateKhoHang(khohang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access CreateKhoHang Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="khohang"></param>
		public void UpdateKhoHang(KhoHang khohang)
		{
			try
			{
				khohangInterfaceObject.UpdateKhoHang(khohang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access UpdateKhoHangException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="khohang"></param>
		public void DeleteKhoHang(KhoHang khohang)
		{
			try
			{
				khohangInterfaceObject.DeleteKhoHang(khohang);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access DeleteKhoHangException", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		public KhoHangs GetAllKhoHang()
		{
			try
			{
				return khohangInterfaceObject.GetAllKhoHang();
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetAllKhoHang Exception", ex);
			}
		}

		/// <summary>
		///
		/// </summary>
		/// <param name="maKho"></param>
		public KhoHang GetKhoHangByID(string maKho)
		{
			try
			{
				return khohangInterfaceObject.GetKhoHangByID(maKho);
			}
			catch (Exception ex)
			{
				throw BusinessException.GetException("Business Access GetKhoHangBy ID Exception", ex);
			}
		}

		#endregion
	}
}
